<!DOCTYPE html>
<html lang="en">
<head>  
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <my-header></my-header>
    <my-header></my-header>
    <my-header></my-header>
    <!-- <MyHeader></MyHeader> -->
  </div>
</body>
<template id="header">
  <header>
      标题 - {{ msg }}
      <button @click="add">{{ count }}</button>
  </header>
</template>
<script src="lib/vue.js"></script>
<script>
  // 谁用谁注册
  new Vue({
    components: {
      // 'my-header': {
      MyHeader: {
        template: '#header',
        data () {
          return {
            msg: 'hello component',
            count: 10
          }
        },
        methods: {
          add () {
            this.count++
          }
        }
      }
    }
  }).$mount('#app')
</script>
</html>